<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="https://cdn.jsdelivr.net/npm/vue@3.2.38/dist/vue.global.min.js"></script>
</head>

<body>
  <div id="app">
    <span>请输入张三的成绩：</span><input type="text" @input="inputChange" v-model="score" max="100" maxlength="3">
    <h2>{{msg}}</h2>
  </div>
  <script>
    Vue.createApp({
      data() {
        return {
          score: 123,
          msg: ''
        }
      },
      methods: {
        inputChange() {
          console.log(this.score)
          if (this.score >= 90)
            this.msg = "张三的成绩优秀"
          else if (this.score >= 75)
            this.msg = "张三的成绩良好"
          else if (this.score >= 60)
            this.msg = "张三的成绩及格"
          else if (this.score < 60)
            this.msg = "张三的成绩不及格"
        }
      }
    }).mount('#app')
  </script>
</body>

</html>